<?php
	require ('function.php');
	session_start();
	$username = $_POST['username'];
	$password = $_POST['password'];
	if ($username && $password){
		try {
			user_login($username,$password);
			$_SESSION['valid_user']  = $username;
			}
			catch(Exception $e){
			echo "Sorry,I can't let you come in.";
			exit;
			}
		}
	check_valid_user();
	echo "Welcome to my manage system! $username ";
	display_menu();
?>